<template>
  <div class="analyse-information tag-scrollbar">
    <div class="analyse-box">
      <el-row :gutter="15">
        <!-- 标签故事 -->
        <el-col :span="12">
          <div class="story-box">
            <!-- 左 -->
            <div class="story-title linear-orange">
              <span class="icon"><icon-svg name="iconCalculateTag"></icon-svg></span><br />
              分析备注
            </div>
            <div class="story-content story-text">
              <el-input type="textarea" :rows="6" disabled v-model="info.iconDescription" resize="none"></el-input>
            </div>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="story-box">
            <div class="story-title linear-blue">
              <span class="icon"><icon-svg name="iconCalculateResult"></icon-svg></span><br />
              运行结果
            </div>
            <div class="story-content">
              <div class="result-title">
                <el-row>
                  <el-col :span="8" align="center">
                    <span>结果</span>
                  </el-col>
                  <el-col :span="16" align="center">
                    <span>上次运行时间</span>
                  </el-col>
                </el-row>
              </div>
              <div class="result-content tag-scrollbar">
                <el-row>
                  <el-col :span="8" align="center" class="success">
                    成功
                  </el-col>
                  <el-col :span="16" align="center">
                    {{ info.updateTime }}
                  </el-col>
                </el-row>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </div>
    <funnel-chart ref="analyseFunnel" :funnelList="funnelList"></funnel-chart>
  </div>
</template>

<script>
import funnelChart from './funnel-chart'
export default {
  components: { funnelChart },
  props: {
    info: {
      type: Object,
      required: true,
      default: () => {}
    }
  },
  data() {
    return {}
  },
  computed: {
    funnelList() {
      return this.info.resultParam ? JSON.parse(this.info.resultParam) : []
    }
  },
  methods: {}
}
</script>

<style lang="scss">
.analyse-information {
  height: calc(100% - 50px);
  overflow-y: auto;
  .analyse-box {
    height: 180px;
    overflow: hidden;
    .story-box {
      margin: 5px 10px 0 0;
      height: 160px;
      border-radius: 5px;
      box-shadow: 1px 1px 3px #ddd, -1px -1px 3px #ddd;
      overflow: hidden;
      position: relative;
      .story-title {
        font-size: 15px;
        font-weight: bold;
        width: 150px;
        height: 100%;
        color: #fff;
        text-align: center;
        position: relative;
        &:before {
          width: 100%;
          height: 100%;
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          background: url(~@/assets/img/params_bg.png) no-repeat 0px 0px/100% 100%;
        }
      }
      .icon {
        display: inline-block;
        width: 80px;
        height: 80px;
        background-color: #fff;
        margin: 30px 0 10px;
        border-radius: 50%;
        svg {
          width: 50px;
          height: 50px;
          margin-top: 15px;
        }
      }
      .linear-orange {
        background: linear-gradient(to bottom, #f3bf7c, #f3b172);
        svg {
          color: #f3b172;
        }
      }
      .linear-blue {
        background: linear-gradient(to bottom, #63a3fc, #5188ec);
        svg {
          color: #5188ec;
        }
      }
      .story-content {
        padding-left: 150px;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        .result-title {
          font-weight: 700;
          height: 50px;
          border-bottom: 1px solid #eee;
          span {
            display: inline-block;
            width: 80%;
            height: 40px;
            line-height: 40px;
            margin: 5px 0;
            background-color: #fcf5e5;
            border-radius: 20px;
          }
        }
        .result-content {
          font-size: 20px;
          font-weight: bold;
          margin-top: 45px;
          .success {
            color: #04bf55;
          }
        }
      }
      .story-text {
        padding: 13px 15px 13px 165px;
        .el-textarea.is-disabled .el-textarea__inner {
          color: #666;
          cursor: default;
          height: 100%;
        }
      }
    }
  }
}
</style>
